/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.openbrew.openbrewrf;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.eclipse.persistence.annotations.CascadeOnDelete;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "BrewNotes")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "BrewNotes.findAll", query = "SELECT b FROM BrewNotes b"),
    @NamedQuery(name = "BrewNotes.findByBnid", query = "SELECT b FROM BrewNotes b WHERE b.bnid = :bnid"),
    @NamedQuery(name = "BrewNotes.findByHydStart", query = "SELECT b FROM BrewNotes b WHERE b.hydStart = :hydStart"),
    @NamedQuery(name = "BrewNotes.findByHydStop", query = "SELECT b FROM BrewNotes b WHERE b.hydStop = :hydStop"),
    @NamedQuery(name = "BrewNotes.findByFlowrate", query = "SELECT b FROM BrewNotes b WHERE b.flowrate = :flowrate"),
    @NamedQuery(name = "BrewNotes.findByHydTemp", query = "SELECT b FROM BrewNotes b WHERE b.hydTemp = :hydTemp"),
    @NamedQuery(name = "BrewNotes.findByVorStart", query = "SELECT b FROM BrewNotes b WHERE b.vorStart = :vorStart"),
    @NamedQuery(name = "BrewNotes.findByVorStop", query = "SELECT b FROM BrewNotes b WHERE b.vorStop = :vorStop"),
    @NamedQuery(name = "BrewNotes.findByVorNotes", query = "SELECT b FROM BrewNotes b WHERE b.vorNotes = :vorNotes"),
    @NamedQuery(name = "BrewNotes.findBySpargeBrix", query = "SELECT b FROM BrewNotes b WHERE b.spargeBrix = :spargeBrix"),
    @NamedQuery(name = "BrewNotes.findByPBVol", query = "SELECT b FROM BrewNotes b WHERE b.pBVol = :pBVol"),
    @NamedQuery(name = "BrewNotes.findByPBBrix", query = "SELECT b FROM BrewNotes b WHERE b.pBBrix = :pBBrix"),
    @NamedQuery(name = "BrewNotes.findByBoilStart", query = "SELECT b FROM BrewNotes b WHERE b.boilStart = :boilStart"),
    @NamedQuery(name = "BrewNotes.findByBoilStop", query = "SELECT b FROM BrewNotes b WHERE b.boilStop = :boilStop"),
    @NamedQuery(name = "BrewNotes.findByWhirlStop", query = "SELECT b FROM BrewNotes b WHERE b.whirlStop = :whirlStop"),
    @NamedQuery(name = "BrewNotes.findByRestStop", query = "SELECT b FROM BrewNotes b WHERE b.restStop = :restStop"),
    @NamedQuery(name = "BrewNotes.findByKOStop", query = "SELECT b FROM BrewNotes b WHERE b.kOStop = :kOStop"),
    @NamedQuery(name = "BrewNotes.findByVolFinal", query = "SELECT b FROM BrewNotes b WHERE b.volFinal = :volFinal"),
    @NamedQuery(name = "BrewNotes.findByBog", query = "SELECT b FROM BrewNotes b WHERE b.bog = :bog"),
    @NamedQuery(name = "BrewNotes.findByBOxy", query = "SELECT b FROM BrewNotes b WHERE b.bOxy = :bOxy"),
    @NamedQuery(name = "BrewNotes.findByMashpH", query = "SELECT b FROM BrewNotes b WHERE b.mashpH = :mashpH"),
    @NamedQuery(name = "BrewNotes.findBySpargepH", query = "SELECT b FROM BrewNotes b WHERE b.spargepH = :spargepH"),
    @NamedQuery(name = "BrewNotes.findByBoilpH", query = "SELECT b FROM BrewNotes b WHERE b.boilpH = :boilpH")})
public class BrewNotes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "BNID")
    private Integer bnid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "HydStart")
    @Temporal(TemporalType.TIME)
    private Date hydStart;
    @Basic(optional = false)
    @NotNull
    @Column(name = "HydStop")
    @Temporal(TemporalType.TIME)
    private Date hydStop;
    @Basic(optional = false)
    @NotNull
    @Column(name = "flowrate")
    private float flowrate;
    @Basic(optional = false)
    @NotNull
    @Column(name = "HydTemp")
    private float hydTemp;
    @Basic(optional = false)
    @NotNull
    @Column(name = "VorStart")
    @Temporal(TemporalType.TIME)
    private Date vorStart;
    @Basic(optional = false)
    @NotNull
    @Column(name = "VorStop")
    @Temporal(TemporalType.TIME)
    private Date vorStop;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 250)
    @Column(name = "VorNotes")
    private String vorNotes;
    @Basic(optional = false)
    @NotNull
    @Column(name = "SpargeBrix")
    private float spargeBrix;
    @Basic(optional = false)
    @NotNull
    @Column(name = "PBVol")
    private float pBVol;
    @Basic(optional = false)
    @NotNull
    @Column(name = "PBBrix")
    private float pBBrix;
    @Basic(optional = false)
    @NotNull
    @Column(name = "BoilStart")
    @Temporal(TemporalType.TIME)
    private Date boilStart;
    @Basic(optional = false)
    @NotNull
    @Column(name = "BoilStop")
    @Temporal(TemporalType.TIME)
    private Date boilStop;
    @Basic(optional = false)
    @NotNull
    @Column(name = "WhirlStop")
    @Temporal(TemporalType.TIME)
    private Date whirlStop;
    @Basic(optional = false)
    @NotNull
    @Column(name = "RestStop")
    @Temporal(TemporalType.TIME)
    private Date restStop;
    @Basic(optional = false)
    @NotNull
    @Column(name = "KOStop")
    @Temporal(TemporalType.TIME)
    private Date kOStop;
    @Basic(optional = false)
    @NotNull
    @Column(name = "KOTemp")
    private float kOTemp;
    @Basic(optional = false)
    @NotNull
    @Column(name = "VolFinal")
    private float volFinal;
    @Basic(optional = false)
    @NotNull
    @Column(name = "BOG")
    private float bog;
    @Basic(optional = false)
    @NotNull
    @Column(name = "BOxy")
    private float bOxy;
    @Basic(optional = false)
    @NotNull
    @Column(name = "MashpH")
    private float mashpH;
    @Basic(optional = false)
    @NotNull
    @Column(name = "SpargepH")
    private float spargepH;
    @Basic(optional = false)
    @NotNull
    @Column(name = "BoilpH")
    private float boilpH;
    @Basic(optional = false)
    @NotNull
    @Column(name = "employeeID")
    private int employeeID;
    @OneToMany
    @JoinTable(
        name="JTBrewNotesToEquip",
        joinColumns={ @JoinColumn(name="BNID", referencedColumnName="BNID")},
        inverseJoinColumns={ @JoinColumn(name="equipID", referencedColumnName="equipID", unique=true)}
    )
    private List<Equipment> equipmentCollection;
    @OneToMany(mappedBy = "brewNoteID")
    private Collection<Brews> brewCollection1;
    @OneToMany(mappedBy = "brewNoteID2")
    private Collection<Brews> brewCollection2;
    @OneToMany(mappedBy = "brewNoteID3")
    private Collection<Brews> brewCollection3;
    @OneToMany(mappedBy = "brewNoteID4")
    private Collection<Brews> brewCollection4;
    @OneToMany(mappedBy = "brewNoteID5")
    private Collection<Brews> brewCollection5;
    @OneToMany(mappedBy = "brewNoteID6")
    private Collection<Brews> brewCollection6;
    @OneToMany
    @JoinTable(
        name="JTBrewNotesToMashNotes",
        joinColumns={ @JoinColumn(name="BNID", referencedColumnName="BNID")},
        inverseJoinColumns={ @JoinColumn(name="noteID", referencedColumnName="noteID", unique=true)}
    )
    private List<MashNotes> mashNoteCollection;
    @OneToMany(cascade=CascadeType.ALL, orphanRemoval = true)
    @CascadeOnDelete
    @JoinTable(
        name="JTBrewNoteToMaltNotes",
        joinColumns={ @JoinColumn(name="BNID", referencedColumnName="BNID")},
        inverseJoinColumns={ @JoinColumn(name="maltNoteID", referencedColumnName="maltNoteID", unique=true)}
    )
    private List<MaltNotes> maltNoteCollection;
    @OneToMany(cascade=CascadeType.ALL, orphanRemoval = true)
    @CascadeOnDelete
    @JoinTable(
        name="JTBrewNoteToBoilHopNotes",
        joinColumns={ @JoinColumn(name="BNID", referencedColumnName="BNID")},
        inverseJoinColumns={ @JoinColumn(name="boilHopNoteID", referencedColumnName="boilHopNoteID", unique=true)}
    )
    private List<BoilHopNotes> boilHopNoteCollection;
    @OneToMany(cascade=CascadeType.ALL, orphanRemoval = true)
    @CascadeOnDelete
    @JoinTable(
        name="JTBrewNotesToAdditiveNotes",
        joinColumns={ @JoinColumn(name="BNID", referencedColumnName="BNID")},
        inverseJoinColumns={ @JoinColumn(name="additiveNoteID", referencedColumnName="additiveNoteID", unique=true)}
    )
    private List<AdditiveNotes> additiveNoteCollection;
    @OneToMany(cascade=CascadeType.ALL, orphanRemoval = true)
    @CascadeOnDelete
    @JoinTable(
        name="JTBrewNotesToSaltNotes",
        joinColumns={ @JoinColumn(name="BNID", referencedColumnName="BNID")},
        inverseJoinColumns={ @JoinColumn(name="saltNoteID", referencedColumnName="saltNoteID", unique=true)}
    )
    private List<SaltNotes> saltNoteCollection;

    public BrewNotes() {
    }

    public BrewNotes(Integer bnid) {
        this.bnid = bnid;
    }

    public BrewNotes(Integer bnid, int employeeID, Date hydStart, Date hydStop, float flowrate, float hydTemp, Date vorStart, Date vorStop, String vorNotes, float spargeBrix, float pBVol, float pBBrix, Date boilStart, Date boilStop, Date whirlStop, Date restStop, Date kOStop, float kOTemp, float volFinal, float bog, float bOxy, float mashpH, float spargepH, float boilpH) {
        this.bnid = bnid;
        this.hydStart = hydStart;
        this.hydStop = hydStop;
        this.flowrate = flowrate;
        this.hydTemp = hydTemp;
        this.vorStart = vorStart;
        this.vorStop = vorStop;
        this.vorNotes = vorNotes;
        this.spargeBrix = spargeBrix;
        this.pBVol = pBVol;
        this.pBBrix = pBBrix;
        this.boilStart = boilStart;
        this.boilStop = boilStop;
        this.whirlStop = whirlStop;
        this.restStop = restStop;
        this.kOStop = kOStop;
        this.kOTemp = kOTemp;
        this.volFinal = volFinal;
        this.bog = bog;
        this.bOxy = bOxy;
        this.mashpH = mashpH;
        this.spargepH = spargepH;
        this.boilpH = boilpH;
        this.employeeID = employeeID;
    }

    public Integer getBnid() {
        return bnid;
    }

    public void setBnid(Integer bnid) {
        this.bnid = bnid;
    }

    public Date getHydStart() {
        return hydStart;
    }

    public void setHydStart(Date hydStart) {
        this.hydStart = hydStart;
    }

    public Date getHydStop() {
        return hydStop;
    }

    public void setHydStop(Date hydStop) {
        this.hydStop = hydStop;
    }

    public float getFlowrate() {
        return flowrate;
    }

    public void setFlowrate(float flowrate) {
        this.flowrate = flowrate;
    }

    public float getHydTemp() {
        return hydTemp;
    }

    public void setHydTemp(float hydTemp) {
        this.hydTemp = hydTemp;
    }

    public Date getVorStart() {
        return vorStart;
    }

    public void setVorStart(Date vorStart) {
        this.vorStart = vorStart;
    }

    public Date getVorStop() {
        return vorStop;
    }

    public void setVorStop(Date vorStop) {
        this.vorStop = vorStop;
    }

    public String getVorNotes() {
        return vorNotes;
    }

    public void setVorNotes(String vorNotes) {
        this.vorNotes = vorNotes;
    }

    public float getSpargeBrix() {
        return spargeBrix;
    }

    public void setSpargeBrix(float spargeBrix) {
        this.spargeBrix = spargeBrix;
    }

    public float getPBVol() {
        return pBVol;
    }

    public void setPBVol(float pBVol) {
        this.pBVol = pBVol;
    }

    public float getPBBrix() {
        return pBBrix;
    }

    public void setPBBrix(float pBBrix) {
        this.pBBrix = pBBrix;
    }

    public Date getBoilStart() {
        return boilStart;
    }

    public void setBoilStart(Date boilStart) {
        this.boilStart = boilStart;
    }

    public Date getBoilStop() {
        return boilStop;
    }

    public void setBoilStop(Date boilStop) {
        this.boilStop = boilStop;
    }

    public Date getWhirlStop() {
        return whirlStop;
    }

    public void setWhirlStop(Date whirlStop) {
        this.whirlStop = whirlStop;
    }

    public Date getRestStop() {
        return restStop;
    }

    public void setRestStop(Date restStop) {
        this.restStop = restStop;
    }

    public Date getKOStop() {
        return kOStop;
    }

    public void setKOStop(Date kOStop) {
        this.kOStop = kOStop;
    }

    public float getKOTemp() {
        return kOTemp;
    }

    public void setKOTemp(float kOTemp) {
        this.kOTemp = kOTemp;
    }

    public float getVolFinal() {
        return volFinal;
    }

    public void setVolFinal(float volFinal) {
        this.volFinal = volFinal;
    }

    public float getBog() {
        return bog;
    }

    public void setBog(float bog) {
        this.bog = bog;
    }

    public float getBOxy() {
        return bOxy;
    }

    public void setBOxy(float bOxy) {
        this.bOxy = bOxy;
    }

    public float getMashpH() {
        return mashpH;
    }

    public void setMashpH(float mashpH) {
        this.mashpH = mashpH;
    }

    public float getSpargepH() {
        return spargepH;
    }

    public void setSpargepH(float spargepH) {
        this.spargepH = spargepH;
    }

    public float getBoilpH() {
        return boilpH;
    }

    public void setBoilpH(float boilpH) {
        this.boilpH = boilpH;
    }

    public List<Equipment> getEquipmentCollection() {
        return equipmentCollection;
    }

    public void setEquipmentCollection(List<Equipment> equipmentCollection) {
        this.equipmentCollection = equipmentCollection;
    }

    public List<MashNotes> getMashNoteCollection() {
        return mashNoteCollection;
    }

    public void setMashNoteCollection(List<MashNotes> mashNoteCollection) {
        this.mashNoteCollection = mashNoteCollection;
    }

    public List<MaltNotes> getMaltNoteCollection() {
        return maltNoteCollection;
    }

    public void setMaltNoteCollection(List<MaltNotes> maltNoteCollection) {
        this.maltNoteCollection = maltNoteCollection;
    }

    public List<BoilHopNotes> getBoilHopNoteCollection() {
        return boilHopNoteCollection;
    }

    public void setBoilHopNoteCollection(List<BoilHopNotes> boilHopNoteCollection) {
        this.boilHopNoteCollection = boilHopNoteCollection;
    }

    public List<AdditiveNotes> getAdditiveNoteCollection() {
        return additiveNoteCollection;
    }

    public void setAdditiveNoteCollection(List<AdditiveNotes> additiveNoteCollection) {
        this.additiveNoteCollection = additiveNoteCollection;
    }

    public List<SaltNotes> getSaltNoteCollection() {
        return saltNoteCollection;
    }

    public void setSaltNoteCollection(List<SaltNotes> saltNoteCollection) {
        this.saltNoteCollection = saltNoteCollection;
    }

    public int getEmployeeID() {
        return employeeID;
    }

    public void setEmployeeID(int employeeID) {
        this.employeeID = employeeID;
    }

    @XmlTransient
    public Collection<Brews> getBrewCollection1() {
        return brewCollection1;
    }

    public void setBrewCollection1(Collection<Brews> brewCollection) {
        this.brewCollection1 = brewCollection;
    }

    @XmlTransient
    public Collection<Brews> getBrewCollection2() {
        return brewCollection2;
    }

    public void setBrewCollection2(Collection<Brews> brewCollection) {
        this.brewCollection2 = brewCollection;
    }

    @XmlTransient
    public Collection<Brews> getBrewCollection3() {
        return brewCollection3;
    }

    public void setBrewCollection3(Collection<Brews> brewCollection) {
        this.brewCollection3 = brewCollection;
    }

    @XmlTransient
    public Collection<Brews> getBrewCollection4() {
        return brewCollection4;
    }

    public void setBrewCollection4(Collection<Brews> brewCollection) {
        this.brewCollection4 = brewCollection;
    }

    @XmlTransient
    public Collection<Brews> getBrewCollection5() {
        return brewCollection5;
    }

    public void setBrewCollection5(Collection<Brews> brewCollection) {
        this.brewCollection5 = brewCollection;
    }

    @XmlTransient
    public Collection<Brews> getBrewCollection6() {
        return brewCollection6;
    }

    public void setBrewCollection6(Collection<Brews> brewCollection) {
        this.brewCollection6 = brewCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (bnid != null ? bnid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BrewNotes)) {
            return false;
        }
        BrewNotes other = (BrewNotes) object;
        if ((this.bnid == null && other.bnid != null) || (this.bnid != null && !this.bnid.equals(other.bnid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.BrewNotes[ bnid=" + bnid + " ]";
    }
    
}
